package cn.biplam.back.operator.systemManage;

import java.util.ArrayList;

import cn.biplam.common.client.DataFilter;
import cn.biplam.common.client.OperatorResult;
import cn.biplam.common.interfaces.DataOperator;
import cn.biplam.common.opcode.SysManageCode.SysManageMenuCode;
import cn.biplam.common.wrapper.ErrorMessage;

/**
 * 系统管理菜单表数据操作类
 * @author XiaoRuxing 2009-5-29下午07:30:00
 * @version 1.0
 */
public class SysManageMenu extends DataOperator{
	
	/** 系统管理菜单表名称 */
	private static final String tName="sys_manage_menu";
	public SysManageMenu() throws ErrorMessage {
		super(tName);
	}
	
	@Override
	protected OperatorResult _exchange() throws ErrorMessage {
		ArrayList<String> sql=new ArrayList<String>();
		if(opId.equals(SysManageMenuCode.Select_All)){
			this.selectAll(sql, filter);
			return this.doing(sql,Operator_Type.Select);
		}else{
			throw new ErrorMessage("Operator Exchange outport not found:"+ opId+" !");
		}
	}

	/**
	 * 查询所有系统管理菜单
	 */
	public void selectAll(ArrayList<String> sql,DataFilter filter){
		StringBuilder sp=new StringBuilder();
		sp.append(" select menu_id, menu_parent, menu_name, actionid from sys_manage_menu ");
		sql.add(sp.toString());
	}
}
